package com.advertisementsystem.Mapper;

import com.advertisementsystem.Dto.NegotiationQueryDTO;
import com.advertisementsystem.entity.AdNegotiation;
import com.advertisementsystem.vo.NegotiationVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;



@Mapper
public interface AdNegotiationMapper extends BaseMapper<AdNegotiation> {

    @Select("SELECT n.* FROM ad_negotiation n " +
            "LEFT JOIN ad_schedule s ON n.ad_id = s.advertisement_id " +
            "WHERE s.device_id = #{deviceId}")
    List<AdNegotiation> findByDeviceId(Long deviceId);
}
